$(document).ready(function() {
	if(!$.cookie('location')){
		getCacheValuesFromServer();
	}
});


function getCacheValuesFromServer(){
	$.get("http://localhost:8085/poc/getCache.htm",handleCache,"html");
}

function handleCache(data){
	var cacheValues = $.parseJSON(data);
	setCookie(cacheValues);
}

function setCookie(cacheValues){
	$.cookie('location', cacheValues['location'], { path: '/' });
	$.cookie('industry', cacheValues['industry'], { path: '/' });
	$.cookie('designation', cacheValues['designation'], { path: '/' });
}

function getCookie(cookieName){
	return $.cookie(cookieName);
}




